<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>供应商公告消息表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="splBullMsgInfo_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        

<div class="fieldBox col_100_auto">
	<div class="label">描述</div>
	<div class="field">
		<input name="descr" id="descr" type="text" class="ui-textbox" ligerui="width:700"  value="${splBullMsgInfoVO.descr}" validate="{required:true,maxlength:500}">
		<span class="requiredSymbol">*</span>
	</div>
</div>
<div class="fieldBox col_100">
	<div class="label">标题</div>
	<div class="field">
		<input name="title" id="title" type="text" class="ui-textbox" value="${splBullMsgInfoVO.title}" validate="{required:true,maxlength:200}">
		<span class="requiredSymbol">*</span>
	</div>
</div>
<div class="fieldBox col_100_auto">
	<div class="label">封面图片</div>
		<div class="field">
			<jsp:include page="../../system/sysUlFilesRec/sysSysUlFilesRecUpload.jsp" flush="true" >
				<jsp:param name="fileNum" value="1"/>
				<jsp:param name="filePath" value="/splmsg"/>
			</jsp:include>
	</div>
</div>
<div class="fieldBox col_100_auto">
	<div class="label">图片地址</div>
		<div class="field">
			<input name="cvrPicUrl" id="cvrPicUrl" type="text" class="ui-textbox" ligerui="width:700" value="${splBullMsgInfoVO.cvrPicUrl}" >
		</div>
</div>
<div class="fieldBox col_100">
	<div class="label">摘要</div>
	<div class="field">
		<input name="abs" id="abs" type="text" class="ui-textbox" value="${splBullMsgInfoVO.abs}" validate="{required:true,maxlength:300}">
		<span class="requiredSymbol">*</span>
	</div>
</div>
<div class="fieldBox col_100">
	<div class="label">内容编号</div>
	<div class="field">
		<input name="cntId" id="cntId" type="text" class="ui-textbox" value="${splBullMsgInfoVO.cntId}" >
	</div>
</div>
<div class="fieldBox col_100_auto">
	<div class="label">内容地址</div>
	<div class="field">
		<input name="cntUrl" id="cntUrl" type="text" ligerui="width:700" class="ui-textbox" value="${splBullMsgInfoVO.cntUrl}" >
	</div>
</div>
    </div>
    <div class="btnsBox">
        <span id="saveSplBullMsgInfo_Btn" class="sq-button sq-button-round l-dialog-btn-ok">保存</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
<script>
    $(function() {
        var splBullMsgInfoId = "${splBullMsgInfoVO.id}";//主键ID
        $("#splBullMsgInfo_form").ligerForm({
            validate: true
        });
        /*保存*/
        $("#saveSplBullMsgInfo_Btn").click(function (event) {
            var form = liger.get("splBullMsgInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var _url;
            if (splBullMsgInfoId == '') {//新增
                _url = '<%=path%>/splmsg/splBullMsgInfo/add.do';
            } else {//修改
                _url = '<%=path%>/splmsg/splBullMsgInfo/modify.do?id=' + splBullMsgInfoId;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        setInterval('Remove_navTab();callback();',1000);
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
    
    var serverpath = '${serverpath}';
	//上传回调方法必须写在上传插件之后
	function uploadCallback(_data){
		if(_data&&_data.length>0) {
			$("#cvrPicUrl").val(serverpath+_data[0].filePath);
		}
	}
</script>
</body>
</html>
